﻿using EyFramework.Sys.Core;
using Ncov2019.Core.Dao;
using Ncov2019.Entity;
using System.Collections.Generic;

namespace Ncov2019.Core.Service
{
    /// <summary>
    ///  NCOV_RECORDS表的服务实现类
    /// </summary>
    public class NcovRecordsService : BaseHisService, INcovRecordsService
    {
        protected readonly INcovRecordsDao _NcovRecordsDao;

        public NcovRecordsService(INcovRecordsDao ncovRecordsDao)
        {
            _NcovRecordsDao = ncovRecordsDao;
        }

        public bool AddNcovRecord(NcovRecords ncovRecords)
        {
            ncovRecords.RECORD_SEQ = GetHisMaxId("NCOV_RECORDS", "RECORD_SEQ");
            return _NcovRecordsDao.Insert(ncovRecords);
        }

        public List<NcovRecords> QueryBy(NcovRecordParam ncovRecordParam)
        {
            return _NcovRecordsDao.QueryBy(ncovRecordParam);
        }

        public NcovRecords QueryById(long id)
        {
            return _NcovRecordsDao.GetById(id);
        }

        public bool UpdateNcovRecord(NcovRecords ncovRecord)
        {
            return _NcovRecordsDao.Update(ncovRecord);
        }
    }
}